/*
 * SpanningTreeCalculator.h
 *
 *  Created on: 03-06-2012
 *      Author: Jakub Chomentowski
 */

#include "NodeStateDescriptor.h"
#include "GraphDescriptor.h"
#include <vector>

#ifndef SPANNINGTREECALCULATOR_H_
#define SPANNINGTREECALCULATOR_H_

class SpanningTreeCalculator
{
	public:
		bool calculateSpanningTree(GraphDescriptor &descriptor, GraphDescriptor &tree);

	private:
		bool ifPossibleToReconnect(int newParent, int tested, GraphDescriptor &descriptro);
		int weightOfGateway(int tested, GraphDescriptor &descriptro);
		void calculateNewTradeOfForChildren(int subTreeRoot, GraphDescriptor &descriptro);


		std::vector<NodeStateDescriptor> allNodes;
};

#endif /* SPANNINGTREECALCULATOR_H_ */
